class Network
{
  // ...
  void train(float [] outputs) {
    // adjust the output layer
    for (int k = 0; k < m_output_layer.length; k++) {
      m_output_layer[k].setError(outputs[k]);
      m_output_layer[k].train();
    }
    // propagate back to the hidden layer
    for (int j = 0; j < m_hidden_layer.length; j++) {
      m_hidden_layer[j].train();
    }
    // The input layer doesn't learn: it is the input and only that
  }
}